This lesson is part of the Sequential Function Charts in Ignition course. You can browse the rest of the lessons below.

LESSON LIST

Autoplay Off

Supplemental Videos

Description

Learn how to design charts by adding elements and connections in the Designer using the element palette and editor.

Video recorded using: Ignition 8.1

Transcript

(open in window)

[00:00] In this lesson, we're going to learn how to create Sequential Function Charts, place elements on them, and configure and connect those elements. Along the way, we'll also learn about how the Designer can give us error feedback about our charts. To create a new chart, we simply right click on Sequential Function Charts and select New Sequential Function Chart. We'll just accept the default name, New Chart, and click on Create Chart, and this creates a new blank chart with its one starting element, a Begin Step. But we'll notice a couple things right away about our new chart. The Chart Design pane says that this is an invalid chart. If we click Show Errors, it highlights in red any elements that have a problem, and if we mouse over the problem element, it tells us that there's a dead end. What this means is, if the chart were to start now, it would just fall out of the bottom of the Begin Step and have nowhere to go, which is not legal.

[01:05] So let's start fixing this problem. For starters, we don't have to keep this Begin Step here where it was initially placed by default. Any step can be selected and moved around by dragging it. Another thing to notice is, when a new element is created, it will get this little connection arrow beneath it. We'll see these arrows appearing in the Designer whenever there's an element that's unconnected. That's a good cue that we should connect something in that location. We can click and drag those arrows to create links that can go to other elements. For example, we'll drag this connection down a bit and create a link. Then let's connect an Action Step at the end of this link. So we'll drag an Action Step from the element palette at the top and place it right underneath like so, and it connects automatically with that link. So now the Begin Step is happy, there's no longer a red marker on it because it's now connected to the Action Step S1. But now the Action Step has the same problem, the Begin Step used to have, it's unconnected to anything.

[02:07] So to solve this, let's extend the connection again, and then place an End Step underneath it. Now in the Chart Design pane, it tells us our chart is now valid. This is a good indication that if we were to save this chart, we could start it up. However, this chart isn't going to do anything because we haven't yet configured our Action Step in any way. To configure an element like an Action Step, we can simply click on it and then over in the Element Properties panel, its configuration interface will appear. If for some reason we don't see the Element Properties panel, we can make it visible by heading up to our menu and selecting View, Panels, Element Properties, then clicking on the element of interest once more if needed. We'll get more into the details of how Action Steps work in a later lesson. For now, we will simply write a quick script that writes to a tag.

[03:01] We've previously set up a string tag named Feedback here in the Tag Browser for that purpose. But before we go any further, let's first make sure that the read write mode is set up here in the Designer toolbar. So let's write a simple script for Action Step S1. We'll select Add, then On Start, and maybe make this panel a bit wider. Then we'll add the system library call system.tag. writeBlocking, which takes some specified text and writes it to the specified tag path. Ahead of this statement we'll add placeholders for both parameters. One thing to be aware of is that, because SFCs are a global resource and not part of any specific project, we need to ensure that a tag provider is part of the specified tag path. For example, here, the tag provider default is part of the project, but the SFC exists outside of the project.

[04:08] When we do a Copy Path on our tag and paste it into our script, within quotes, we see that the default tag provider is part of the name. Then we'll also add some text to be written. So at this point, we can save our chart, and watch our tag. We'll go ahead and start our chart, and there we go. The S1 On Start script has written the specified text to our tag. So you can start to see how charts are pretty easy to configure. They use drag and drop, we connect links to anything that's unconnected, and when things aren't properly configured, the Designer will tell us that things are wrong until we fix them. Finally, let's look at how to create links that branch and loop. We'll start out by selecting this End Step and its preceding connections, and clicking delete.

[05:07] No surprise, we've now got an invalid chart we need to fix. Now, let's say we want to branch this chart into three parallel directions. So we'll place three separate transition elements, connect the middle element, and then when we click that transition, we now have options to connect the left and right transitions off that original connection. Now we have some branched links, so we can have exclusive logic in our chart. We can also create looping connections. So for example, let's create a series of connections so that we have a feedback loop path ahead of the S1 Action Step. But our chart is still invalid because the other branches are unconnected. To remedy this, we'll add an End Step, connect to it from the middle transition, and then connect to it from the right transition.

[06:04] Now our chart is valid again because there are no unconnected steps. So in summary, we've seen the basics of designing charts. To create elements, we simply drag them onto the chart. To connect elements, we use the connection arrows to draw links. And to configure elements, we make sure the element properties panel is visible, and then we just click on the element we'd like to configure. And we've also seen the basics of branching and looping structures.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.